---------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/log/Table_A15_Results.log
  log type:  text
 opened on:   8 Jun 2024, 11:53:09

. use "$rootpath/processed_data/ML_dataAPR24.dta", clear

. drop if tot_damage>1e+08
(133 observations deleted)

. //ssc install vselect
. //vselect tot_damage M1 M2 M3 M4 G1 G2 G3 G4 G5 G6 G7 G8 G9 G10, best
. vselect log_damage M1 M2 M3 M4 G1 G2 G3 G4 G5 G6 G7 G8 G9 G10, best

Response :             log_damage
Selected predictors:   G8 M1 M3 G6 G1 G9 G2 G5 G7 G3 G10 G4 M2 M4

Optimal models: 

   # Preds     R2ADJ         C       AIC      AICC       BIC
         1  .0375963   141.005  9257.016  9257.028  9268.357
         2  .0664003  73.70316  9192.867  9192.886  9209.878
         3  .0834275  34.35155  9154.402   9154.43  9177.084
         4  .0885047  23.32061   9143.49   9143.53  9171.843
         5  .0915559  17.09376  9137.299  9137.351  9171.321
         6  .0948627   10.2695  9130.477  9130.545   9170.17
         7  .0967468  6.814935  9127.006  9127.091   9172.37
         8  .0970446  7.112008  9127.295  9127.398  9178.329
         9  .0971266  7.919197  9128.096   9128.22    9184.8
        10  .0970794  9.031482  9129.203  9129.349  9191.578
        11  .0969576  10.31982  9130.487  9130.658  9198.532
        12   .096803  11.68523  9131.848  9132.045  9205.564
        13  .0965528  13.27535  9133.436  9133.661  9212.822
        14  .0962454        15  9135.158  9135.414  9220.215

predictors for each model:

1  :  G8
2  :  G8 M1
3  :  G8 M1 M3
4  :  G8 M1 M3 G6
5  :  G8 M1 M3 G6 G1
6  :  G8 M1 M3 G6 G1 G2
7  :  G8 M1 M3 G6 G1 G9 G2
8  :  G8 M1 M3 G6 G1 G9 G2 G5
9  :  G8 M1 M3 G6 G1 G9 G2 G5 G7
10 :  G8 M1 M3 G6 G1 G9 G2 G5 G7 G3
11 :  G8 M1 M3 G6 G1 G9 G2 G5 G7 G3 G10
12 :  G8 M1 M3 G6 G1 G9 G2 G5 G7 G3 G10 G4
13 :  G8 M1 M3 G6 G1 G9 G2 G5 G7 G3 G10 G4 M2
14 :  G8 M1 M3 G6 G1 G9 G2 G5 G7 G3 G10 G4 M2 M4

. 
. //Factor Analysis 
. 
. tetrachoric G1 G2 G3 G4 G5 G6 G7 G8 G9 G10 M1 M2 M3 M4, stats(rho se p obs)

+-------------------+
|  Key              |
|-------------------|
|   rho             |
|   Std. error      |
|   2-sided exact P |
|   Number of obs   |
+-------------------+

matrix with tetrachoric correlations is not positive semidefinite;
  it has 3 negative eigenvalues
  maxdiff(corr,adj-corr) =  0.6372
  (adj-corr: tetrachoric correlations adjusted to be positive semidefinite)

             |       G1       G2       G3       G4       G5       G6       G7       G8       G9      G10       M1       M2       M3       M4
-------------+------------------------------------------------------------------------------------------------------------------------------
          G1 |   1.0000 
             |   0.0000 
             | 
             |     2144 
             |
          G2 |  -0.3513   1.0000 
             |   0.0786   0.0000 
             |   0.0000 
             |     2144     2144 
             |
          G3 |  -0.1510  -0.1125   1.0000 
             |   0.1050   0.0838   0.0000 
             |   0.2789   0.2466 
             |     2144     2144     2144 
             |
          G4 |   0.0205   0.0974  -1.0000   1.0000 
             |   0.1205   0.0972        .   0.0000 
             |   0.7510   0.3223   0.4046 
             |     2144     2144     2144     2144 
             |
          G5 |  -0.1903  -0.3908  -0.2955  -0.3064   1.0000 
             |   0.0702   0.0610   0.0927   0.1341   0.0000 
             |   0.0121   0.0000   0.0032   0.0528 
             |     2144     2144     2144     2144     2144 
             |
          G6 |  -0.0814  -0.1706  -0.0411  -0.0944  -0.2556   1.0000 
             |   0.0780   0.0674   0.0913   0.1281   0.0683   0.0000 
             |   0.4376   0.0167   0.8416   0.7662   0.0004 
             |     2144     2144     2144     2144     2144     2144 
             |
          G7 |  -0.3362  -0.3702  -0.4217  -0.0198  -0.4110  -0.2778   1.0000 
             |   0.0530   0.0432   0.0658   0.0835   0.0417   0.0505   0.0000 
             |   0.0000   0.0000   0.0000   0.8672   0.0000   0.0000 
             |     2144     2144     2144     2144     2144     2144     2144 
             |
          G8 |  -0.3008  -0.2538  -0.3407  -0.1580  -0.4273  -0.2859  -0.4562   1.0000 
             |   0.0643   0.0519   0.0818   0.1014   0.0512   0.0604   0.0362   0.0000 
             |   0.0000   0.0000   0.0001   0.2168   0.0000   0.0000   0.0000 
             |     2144     2144     2144     2144     2144     2144     2144     2144 
             |
          G9 |  -0.2315   0.1230   0.0738  -1.0000  -0.2569   0.1645  -0.0058  -0.3439   1.0000 
             |   0.1418   0.0866   0.1222        .   0.1116   0.0929   0.0751   0.1030   0.0000 
             |   0.2617   0.1368   0.4669   1.0000   0.0383   0.0678   1.0000   0.0021 
             |     2144     2144     2144     2144     2144     2144     2144     2144     2144 
             |
         G10 |  -1.0000  -0.0124   0.0665  -1.0000  -1.0000   0.0768   0.1125  -0.2400   0.1550   1.0000 
             |        .   0.1432   0.1823        .        .   0.1477   0.1102   0.1529   0.1892   0.0000 
             |   0.6261   1.0000   0.5068   1.0000   0.1517   0.6438   0.3151   0.2223   0.3423 
             |     2144     2144     2144     2144     2144     2144     2144     2144     2144     2144 
             |
          M1 |  -0.3494  -0.2965  -1.0000  -0.1409  -0.3620  -0.5127  -0.3600  -0.0411  -1.0000  -1.0000   1.0000 
             |   0.0859   0.0655        .   0.1243   0.0656   0.0965   0.0463   0.0534        .        .   0.0000 
             |   0.0001   0.0000   0.0002   0.4239   0.0000   0.0000   0.0000   0.5265   0.0082   0.4061 
             |     2144     2144     2144     2144     2144     2144     2144     2144     2144     2144     2144 
             |
          M2 |  -0.1460  -0.1452   0.0850   0.0939  -0.2719  -0.0546  -0.1529  -0.1724  -1.0000  -1.0000   0.0486   1.0000 
             |   0.1555   0.1258   0.1423   0.1814   0.1405   0.1328   0.0926   0.1107        .        .   0.1135   0.0000 
             |   0.7226   0.4190   0.3755   0.4467   0.1128   1.0000   0.1363   0.1801   1.0000   1.0000   0.5600 
             |     2144     2144     2144     2144     2144     2144     2144     2144     2144     2144     2144     2144 
             |
          M3 |  -0.0454  -0.1749  -1.0000   0.0064  -1.0000  -0.2638  -0.0812  -0.0382   0.0859   0.1518  -0.0688  -1.0000   1.0000 
             |   0.1147   0.1056        .   0.1718        .   0.1375   0.0757   0.0849   0.1411   0.1889   0.1038        .   0.0000 
             |   1.0000   0.2016   0.2737   1.0000   0.0008   0.1225   0.3122   0.8600   0.3704   0.3476   0.6501   1.0000 
             |     2144     2144     2144     2144     2144     2144     2144     2144     2144     2144     2144     2144     2144 
             |
          M4 |  -0.1640  -0.3811  -0.1713  -0.0294  -0.3941  -0.2994  -0.1966  -0.3869  -0.0800  -1.0000  -0.3414  -1.0000   0.0427   1.0000 
             |   0.1192   0.1201   0.1491   0.1678   0.1182   0.1316   0.0715   0.0967   0.1612        .   0.1257        .   0.1377   0.0000 
             |   0.3191   0.0034   0.5182   1.0000   0.0014   0.0602   0.0083   0.0002   1.0000   1.0000   0.0117   0.6235   0.6743 
             |     2144     2144     2144     2144     2144     2144     2144     2144     2144     2144     2144     2144     2144     2144 
             |

. factor G1 G2 G3 G4 G5 G6 G7 G8 G9 G10 M1 M2 M3 M4, pcf
(obs=2,144)

Factor analysis/correlation                      Number of obs    =      2,144
    Method: principal-component factors          Retained factors =          9
    Rotation: (unrotated)                        Number of params =         90

    --------------------------------------------------------------------------
         Factor  |   Eigenvalue   Difference        Proportion   Cumulative
    -------------+------------------------------------------------------------
        Factor1  |      1.29117      0.08608            0.0922       0.0922
        Factor2  |      1.20510      0.03659            0.0861       0.1783
        Factor3  |      1.16851      0.08791            0.0835       0.2618
        Factor4  |      1.08060      0.01215            0.0772       0.3390
        Factor5  |      1.06844      0.01174            0.0763       0.4153
        Factor6  |      1.05670      0.02024            0.0755       0.4908
        Factor7  |      1.03646      0.03035            0.0740       0.5648
        Factor8  |      1.00611      0.00352            0.0719       0.6366
        Factor9  |      1.00258      0.02174            0.0716       0.7083
       Factor10  |      0.98085      0.01328            0.0701       0.7783
       Factor11  |      0.96757      0.02169            0.0691       0.8474
       Factor12  |      0.94588      0.02625            0.0676       0.9150
       Factor13  |      0.91964      0.64924            0.0657       0.9807
       Factor14  |      0.27040            .            0.0193       1.0000
    --------------------------------------------------------------------------
    LR test: independent vs. saturated:  chi2(91) = 1408.00 Prob>chi2 = 0.0000

Factor loadings (pattern matrix) and unique variances

    -----------------------------------------------------------------------------------------------------------------------
        Variable |  Factor1   Factor2   Factor3   Factor4   Factor5   Factor6   Factor7   Factor8   Factor9 |   Uniqueness 
    -------------+------------------------------------------------------------------------------------------+--------------
              G1 |  -0.0527    0.2166   -0.2201    0.5937    0.4100    0.0090   -0.2544    0.2394    0.2024 |      0.2182  
              G2 |  -0.0581    0.3076    0.5510   -0.4958    0.3603   -0.2023   -0.0013    0.0494    0.0514 |      0.1768  
              G3 |  -0.0268    0.3790    0.1593    0.1229   -0.1511    0.3823    0.4284   -0.1644    0.4601 |      0.2240  
              G4 |   0.0640   -0.0473    0.1221   -0.0543    0.6019    0.0609   -0.2435   -0.0861   -0.0070 |      0.5431  
              G5 |  -0.1146    0.3904   -0.7175   -0.3621   -0.1149   -0.2164    0.0221    0.0949    0.0347 |      0.1178  
              G6 |   0.0953    0.4216    0.1747    0.3231   -0.2858    0.1489   -0.3496   -0.0431   -0.5087 |      0.1916  
              G7 |   0.7821   -0.4698   -0.0906   -0.0953   -0.0696    0.0866   -0.1257   -0.1400    0.0719 |      0.0974  
              G8 |  -0.6124   -0.3352    0.2148    0.1508   -0.2539   -0.2075   -0.2115   -0.4086    0.1530 |      0.1011  
              G9 |   0.2391    0.2439    0.3338   -0.0083   -0.2315   -0.1542    0.0822    0.2028   -0.2631 |      0.5774  
             G10 |   0.2008    0.0109    0.1969    0.0497   -0.3014   -0.0685    0.0149    0.2981    0.3794 |      0.5897  
              M1 |  -0.4035   -0.3912   -0.0086   -0.1480   -0.0290    0.3133    0.1664    0.5047   -0.3215 |      0.1774  
              M2 |  -0.0506   -0.0094    0.0364   -0.0411    0.1094    0.6771    0.0509    0.0562    0.0155 |      0.5179  
              M3 |   0.0324   -0.2009    0.1456    0.3024    0.0386   -0.3564    0.1940    0.4808    0.1336 |      0.4308  
              M4 |   0.0860   -0.0367   -0.0609    0.2818    0.2499   -0.1848    0.6862   -0.3089   -0.3522 |      0.1211  
    -----------------------------------------------------------------------------------------------------------------------

. 
. rotate, promax blanks(.3)

Factor analysis/correlation                      Number of obs    =      2,144
    Method: principal-component factors          Retained factors =          9
    Rotation: oblique promax (Kaiser off)        Number of params =         90

    --------------------------------------------------------------------------
         Factor  |     Variance   Proportion    Rotated factors are correlated
    -------------+------------------------------------------------------------
        Factor1  |      1.21785       0.0870
        Factor2  |      1.17111       0.0837
        Factor3  |      1.14707       0.0819
        Factor4  |      1.13878       0.0813
        Factor5  |      1.10328       0.0788
        Factor6  |      1.10313       0.0788
        Factor7  |      1.08942       0.0778
        Factor8  |      1.05431       0.0753
        Factor9  |      1.04158       0.0744
    --------------------------------------------------------------------------
    LR test: independent vs. saturated:  chi2(91) = 1408.00 Prob>chi2 = 0.0000

Rotated factor loadings (pattern matrix) and unique variances

    -----------------------------------------------------------------------------------------------------------------------
        Variable |  Factor1   Factor2   Factor3   Factor4   Factor5   Factor6   Factor7   Factor8   Factor9 |   Uniqueness 
    -------------+------------------------------------------------------------------------------------------+--------------
              G1 |                                                     0.9425                               |      0.2182  
              G2 |                       0.9456                                                             |      0.1768  
              G3 |                                                               0.9185                     |      0.2240  
              G4 |                       0.3253                                                             |      0.5431  
              G5 |            -1.0132                                                                       |      0.1178  
              G6 |                                           0.9602                                         |      0.1916  
              G7 |   0.3201             -0.3335                                                             |      0.0974  
              G8 |  -1.0181                                                                                 |      0.1011  
              G9 |                                           0.3986                                         |      0.5774  
             G10 |                                                                         0.4776   -0.3099 |      0.5897  
              M1 |                                 0.9587                                                   |      0.1774  
              M2 |                                 0.3426                        0.3264   -0.3573           |      0.5179  
              M3 |                                                                         0.7590           |      0.4308  
              M4 |                                                                                   0.9720 |      0.1211  
    -----------------------------------------------------------------------------------------------------------------------
    (blanks represent abs(loading)<.3)

Factor rotation matrix

    -----------------------------------------------------------------------------------------------
                 | Factor1  Factor2  Factor3  Factor4  Factor5  Factor6  Factor7  Factor8  Factor9 
    -------------+---------------------------------------------------------------------------------
         Factor1 |  0.0846  -0.5162   0.4607  -0.1535   0.5899   0.2325   0.4690   0.0092   0.0681 
         Factor2 |  0.8330   0.3961  -0.3017  -0.6436  -0.0576  -0.3367  -0.2000   0.1254  -0.1378 
         Factor3 |  0.2158   0.2364   0.4459   0.0316  -0.4231   0.6320  -0.2939  -0.4230   0.3071 
         Factor4 | -0.1179   0.5765   0.5405   0.0084   0.2500  -0.1989   0.1717   0.2425  -0.0790 
         Factor5 | -0.1846   0.2229  -0.3631  -0.0566   0.2803   0.5290   0.1363   0.2393   0.2875 
         Factor6 |  0.2993   0.3336  -0.2479   0.4061   0.0165   0.0711   0.4630  -0.5768  -0.2855 
         Factor7 |  0.3145  -0.1041   0.0927   0.4907   0.0620   0.1839  -0.0179   0.5167  -0.2949 
         Factor8 |  0.0988  -0.1222   0.0194   0.2294  -0.1670  -0.2294   0.4586   0.2562   0.6465 
         Factor9 | -0.0782   0.0398  -0.0586  -0.3156  -0.5446   0.1491   0.4250   0.1546  -0.4546 
    -----------------------------------------------------------------------------------------------

. 
. predict f1 f2 f3 f4 f5 f6 f7 f8 
(regression scoring assumed)

Scoring coefficients (method = regression; based on promax(3) rotated factors)

    --------------------------------------------------------------------------------------------------------
        Variable |  Factor1   Factor2   Factor3   Factor4   Factor5   Factor6   Factor7   Factor8   Factor9 
    -------------+------------------------------------------------------------------------------------------
              G1 |  0.02221   0.01172  -0.03171  -0.02163  -0.00116   0.75692  -0.00489   0.00638  -0.01446 
              G2 |  0.03998   0.03292   0.75200  -0.03979  -0.02803  -0.04553  -0.02031   0.00201  -0.02597 
              G3 |  0.00362   0.00541  -0.00319  -0.02798  -0.01067  -0.00692   0.78709   0.00412   0.00629 
              G4 |  0.12411   0.27869   0.26651  -0.07456  -0.21359   0.32406  -0.26529  -0.35780   0.00092 
              G5 |  0.03239  -0.73586  -0.02423  -0.02511  -0.02565  -0.01481  -0.02186  -0.01404  -0.01785 
              G6 | -0.00447   0.01071  -0.02392  -0.00637   0.76881   0.01979  -0.00995  -0.03490  -0.00932 
              G7 |  0.44609   0.42095  -0.44112  -0.41321  -0.30750  -0.34827  -0.29481  -0.07910  -0.24261 
              G8 | -0.73597   0.04446  -0.04418  -0.03991  -0.02868  -0.03696  -0.02753  -0.00881  -0.02643 
              G9 |  0.14043  -0.00923   0.16972  -0.01360   0.40942  -0.24377   0.02323   0.35225   0.04971 
             G10 |  0.08669   0.05849  -0.07254  -0.10866  -0.02042  -0.13471   0.22335   0.44346  -0.33918 
              M1 |  0.01992   0.01684  -0.02667   0.76240  -0.01843  -0.02967  -0.03605   0.01455  -0.00917 
              M2 |  0.20512   0.22473  -0.06910   0.32604  -0.05115   0.09663   0.29906  -0.37563  -0.15179 
              M3 |  0.00569   0.05894   0.02121   0.09418  -0.08526   0.13969  -0.05655   0.59350   0.08270 
              M4 |  0.00529   0.00417  -0.00436  -0.00496  -0.00187  -0.00650   0.00913   0.01646   0.86794 
    --------------------------------------------------------------------------------------------------------


. log close
      name:  <unnamed>
       log:  /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/log/Table_A15_Results.log
  log type:  text
 closed on:   8 Jun 2024, 11:53:09
---------------------------------------------------------------------------------------------------------------------------------------------------------
